/*
 * Copyright (c) @ justbk. 2021-2031. All rights reserved.
 */
package org.opengauss.mapper;

import org.opengauss.vo.ByteaVo;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Title: the ByteaMapper interface.
 * <p>
 * Description:
 *
 * @author justbk
 * @version [issueManager 0.0.1, 2022/11/18]
 * @since 2022/11/18
 */
public interface ByteaMapper {
    @Select("select case when max(id) is null then 0 else max(id)+1 end as maxId  from t_bytea")
    int selectMaxId();
    List<ByteaVo> selectAll();
    ByteaVo selectByteaById(int id);
    int insertByteaOne(ByteaVo vo);
    @Update("create table if not exists t_bytea(id int primary key, descdata bytea, val1 bytea)")
    void createTable();
    
    @Update("drop table if exists t_bytea")
    void dropTable();
}
